{% extends "base.html" %}
{% block title %}Blog{% endblock %}
{% block css %}blog.css{% endblock %}
{% block content %}
	{% if post_list|length_is:"0" %}
		<div class="empty_blog_notice">
			No posts here. Please come back later.
		</div>
	{% else %}
		{% include "blog/sidebar.html" %}
		{% if key %}
			<div class="filter">
				{{ key.postset_description }}
			</div>
		{% endif %}
		{% if day %}
			<div class="filter">
				Showing posts from {{ day|date:"F dS Y" }}.
			</div>
		{% endif %}
		{% if month %}
			<div class="filter">
				Showing posts from {{ month|date:"F Y" }}.
			</div>
		{% endif %}
		{% if year %}
			<div class="filter">
				Showing posts from {{ year }}.
			</div>
		{% endif %}
		<ul class="post_list">
		{% for post in post_list %}
			<li class="post">
				{% include "blog/post_detail__box.html" %}
			</li>
		{% endfor %}
		</ul>
		{% if is_paginated %}
			<div class="pages">
				Pages:
				{% for p in paginator.page_range %}
					{% ifequal p page %}
						<span>{{ p }}</span>{% if not forloop.last %},{% endif %}
					{% else %}
						{% if key %}
							<a href="{{ p }}">{{ p }}</a>{% if not forloop.last %},{% endif %}
						{% else %}
							<a href="{% url blog-index p %}">{{ p }}</a>{% if not forloop.last %},{% endif %}
						{% endif %}
					{% endifequal %}
				{% endfor %}
			</div>
		{% endif %}
	{% endif %}
{% endblock %}